import { messages } from 'share/common';

export const ruleItems = [
  {
    id: 'name',
    label: messages('expense-reimbursement-control.key31')/*规则名称*/,
    type: 'LanguageInput',
  },
  {
    id: 'forms',
    label: messages('expense-reimbursement-control.key53')/*适用单据*/,
    type: 'Chooser',
  },
  {
    id: 'companys',
    label: messages('expense-reimbursement-control.key54')/*适用公司*/,
    type: 'Chooser',
  },
  {
    id: 'controlLevel',
    label: messages('expense-reimbursement-control.key62')/*控制力度*/,
    type: 'ReimbursementSubmissionRadio',
  },
  {
    id: 'status',
    label: messages('common.column.status')/*状态*/,
    type: 'Switch',
  },
  {
    id: 'message',
    label: messages('expense-reimbursement-control.key64')/*提示内容*/,
    type: 'LanguageInput',
  }
];

// 管控项
export const controlItems = [
  {
    key: 1001,
    value: messages('common.expense.type')/*费用类型*/,
    valueType: 'valueIncludeTypes',
    controlCond: 'conditionEx',
    fieldValue: {
      type: 'Chooser'
    }
  },
  {
    key: 1002,
    value: messages('expense-reimbursement-control.key117')/*同一消费日期*/,
    valueType: 'valueIncludeTypes',
    controlCond: 'conditionEx',
    fieldValue: {
      type: 'Chooser'
    }
  },
  {
    key: 1003,
    value: messages('expense-reimbursement-control.key118')/*报销单起止日期*/,
    valueType: 'valueIncludeTypes',
    controlCond: 'conditionIn'
  },
  {
    key: 1004,
    value: messages('expense-reimbursement-control.key119')/*关联申请单的起止日期*/,
    valueType: 'valueIncludeTypes',
    controlCond: 'conditionIn'
  },
  {
    key: 1005,
    value: messages('expense-reimbursement-control.key120')/*报销次数*/,
    valueType: 'valueCompareTypes',
    controlCond: 'conditionNu',
    mixedItem: 'mixedItemDa',
    fieldValue: {
      type: 'InputNumber'
    },
    extendValue: {
      type: 'Chooser'
    }
  },
  {
    key: 1006,
    value: messages('expense-reimbursement-control.key121')/*报销单提交日期*/,
    valueType: 'valueCompareTypes',
    controlCond: 'conditionDa',
    mixedItem: 'mixedItemFl',
    extendValue: {
      type: 'InputNumber'
    }
  },
  {
    key: 1007,
    value: messages('expense-reimbursement-control.key122')/*报销单提交月*/,
    valueType: 'valueCompareTypes',
    controlCond: 'conditionMo'
  },
  {
    key: 1008,
    value: messages('expense-reimbursement-control.key123')/*报销单提交年*/,
    valueType: 'valueCompareTypes',
    controlCond: 'conditionYe'
  }
];

// 取值方式1
export const valueIncludeTypes = [
  {
    key: 1001,
    value: messages('expense-reimbursement-control.key72')/*不包含*/
  },
  {
    key: 1002,
    value: messages('expense-reimbursement-control.key71')/*包含*/
  }
];

// 取值方式2
export const valueCompareTypes = [
  {
    key: 1003,
    value: '>'
  },
  {
    key: 1004,
    value: '>='
  },
  {
    key: 1005,
    value: '<'
  },
  {
    key: 1006,
    value: '<='
  },
  {
    key: 1007,
    value: '='
  },
  {
    key: 1008,
    value: '≠'
  }
];

//管控条件1
export const conditionEx = [
  {
    key: 1001,
    value: messages('common.expense.type')/*费用类型*/
  }
];

// 管控条件2
export const conditionIn = [
  {
    key: 1003,
    value: messages('expense-reimbursement-control.key124')/*发票开票日期*/
  },
  {
    key: 1002,
    value: messages('expense-reimbursement-control.key125')/*费用消费日期*/
  }
];

// 管控条件3
export const conditionDa = [
  {
    key: 1004,
    value: messages('expense-reimbursement-control.key126')/*关联申请的结束日期*/
  },
  {
    key: 1002,
    value: messages('expense-reimbursement-control.key125')/*费用消费日期*/
  }
];

//管控条件4
export const conditionMo = [
  {
    key: 1005,
    value: messages('expense-reimbursement-control.key127')/*费用消费月*/
  }
];

//管控条件5
export const conditionYe = [
  {
    key: 1006,
    value: messages('expense-reimbursement-control.key128')/*费用消费年*/
  }
];

//管控条件6

export const conditionNu = [
  {
    key: 1007,
    value: messages('expense-reimbursement-control.key129')/*自定义数*/
  }
];

// 底部条件1
export const mixedItemFl = [
  {
    key: 1001,
    value: '+'
  },
  {
    key: 1002,
    value: '-'
  }
];

// 底部条件2
export const mixedItemDa = [
  {
    key: 2001,
    value: messages('expense-reimbursement-control.key130')/*天*/
  },
  {
    key: 2002,
    value: messages('expense-reimbursement-control.key131')/*月*/
  },
  {
    key: 2003,
    value: messages('expense-reimbursement-control.key132')/*季度*/
  },
  {
    key: 2004,
    value: messages('expense-reimbursement-control.key133')/*年*/
  }
];



